<?php

namespace app\admin\model\xilujob;

use think\Model;
use traits\model\SoftDelete;

class Banner extends Model
{

    use SoftDelete;

    

    // 表名
    protected $name = 'xilujob_banner';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [

    ];
    

    protected static function init()
    {
        self::afterInsert(function ($row) {
            $pk = $row->getPk();
            $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
        });
    }

    
    public function getStatusList()
    {
        return ['0' => __('Status 0'), '1' => __('Status 1')];
    }

    /**
     * @return \string[][]
     */
    public function banner_group(){
        return [
            'index' => array (
                'name' => '首页',
                'size' => '700*500',
            ),
            'job_index' =>
                array (
                    'name' => '找工作首页',
                    'size' => '700*500',
                ),
            'resume_index' =>
                array (
                    'name' => '找人才首页',
                    'size' => '700*500',
                ),
        ];

    }

}
